---
title: 'All Nodes'
---

# All Nodes

The following is all of the nodes built-in to the core of Rivet.

## Text

| Node                                                               | Description                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Chunk](./chunk.mdx)                                               | Splits a string into an array of strings based on a token count. Useful for avoiding token count limits in LLMs, truncating a string to a certain token count, and ensuring context is not lost between chunks by specifying an overlap percentage.                                          |
| [Extract Markdown Code Blocks](./extract-markdown-code-blocks.mdx) | Extracts code blocks from a Markdown text, including all matched blocks and their specified languages. Especially useful when working with LLMs trained extensively on replying with markdown data.                                                                                          |
| [Extract with Regex](./extract-with-regex.mdx)                     | Extracts one or more strings from a string using a regular expression. Useful for parsing a response to extract specific values or determining if the regex matched the input string.                                                                                                        |
| [Join](./join.mdx)                                                 | Concatenates an array of strings into a single string using a specified delimiter. Capable of flattening arrays of strings and supports the use of special characters as delimiters.                                                                                                         |
| [Prompt](./prompt.mdx)                                             | Creates a chat message with an attached "type" indicating who sent the message (User, Assistant, System) and optionally an attached "name". Provides interpolation capabilities to dynamically insert values into the message, and can compute a token count for the generated chat message. |
| [Split Text](./split-text.mdx)                                     | Splits a string into an array of substrings based on a specified delimiter, which can be set either directly in the node settings or dynamically via an input port. Useful for separating a string into individual elements for further processing.                                          |
| [Text](./text.mdx)                                                 | Outputs a string of text and supports interpolation using `{{tags}}` within the text. Useful for creating dynamic, richly formatted text and supports markdown.                                                                                                                              |
| [To JSON](./to-json.mdx)                                           | Converts any given input into its JSON equivalent, effectively stringifying the value. Provides an option to format the JSON output with indentation for easier reading.                                                                                                                     |
| [To YAML](./to-yaml.mdx)                                           | Converts an object into a YAML string, beneficial when you need to output your data in a YAML format. Throws an error if the input is not an object.                                                                                                                                         |

## AI

| Node                                           | Description                                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Assemble Prompt](./assemble-prompt.mdx)       | Assembles multiple chat messages into a single prompt. Takes multiple chat messages or strings as inputs and outputs a single prompt containing all the messages. Also capable of converting non-chat message inputs into a chat message format.                                                            |
| [Chat](./chat.mdx)                             | Sends one or more messages to an LLM - OpenAI's GPT or any API compatible with the OpenAI API, and returns the response from the LLM. Can be used for local LLMs as long as their API is compatible with the OpenAI API.                                                                                    |
| [GPT Function](./gpt-function.mdx)             | Allows the definition of a function that can be called by OpenAI's GPT in its responses, facilitating GPT's "function-calling" capability. The function is defined using JSON Schema and the output can be connected to other nodes such as the Chat Node or Array Node.                                    |
| [Get Embedding](./get-embedding.mdx)           | Generates a vector embedding for a given input text, allowing text to be converted into a numerical representation for operations such as K-nearest neighbor search. Requires an integration, such as OpenAI, to generate the embedding.                                                                    |
| [Trim Chat Messages](./trim-chat-messages.mdx) | Manages the length of chat message chains in terms of tokens. Trims messages from either the beginning or the end of the list until the total length of the messages is under the configured token length. Ideal for setting up infinite message chains that stay under the language model's context limit. |

## MCP

| Node                                        | Description                                                                                         |
| ------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [MCP Discovery Node](./mcp-discovery.mdx)   | Connects to an MCP (Model Context Protocol) server to discover capabilities like tools and prompts. |
| [MCP Tool Call Node](./mcp-tool-call.mdx)   | Connects to an MCP (Model Context Protocol) server and gets a tool call response.                   |
| [MCP Get Prompt Node](./mcp-get-prompt.mdx) | Connects to an MCP (Model Context Protocol) server and gets a prompt response.                      |

## Lists

| Node                     | Description                                                                                                                                                                                                                                          |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Array](./array.mdx)     | Constructs arrays from multiple inputs of any type or merges several arrays into a single one. Offers a 'Flatten' setting enabling the merging of array inputs into the output array, and a 'Deep' setting for recursive flattening of array inputs. |
| [Filter](./filter.mdx)   | Filters elements of an array based on a corresponding array of boolean values. Useful for filtering an array based on certain conditions.                                                                                                            |
| [Pop](./pop.mdx)         | Removes either the first or last element from an array, outputting both the removed element and the remaining array. Useful for processing array elements one by one in a loop.                                                                      |
| [Shuffle](./shuffle.mdx) | Randomizes the order of elements in an array. Uses the Fisher-Yates (aka Knuth) shuffle algorithm to ensure a fair distribution of permutations, and does not modify the original array.                                                             |
| [Slice](./slice.mdx)     | Extracts a specific portion of an array. Takes an array as input and outputs a new array that starts at a specified index and contains a specified number of elements.                                                                               |

## Numbers

| Node                       | Description                                                                                                                                                                                                                                            |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Evaluate](./evaluate.mdx) | Performs a variety of mathematical operations such as addition, subtraction, multiplication, division, exponentiation, modulus, absolute value, and negation on input values and provides the result. Allows dynamic operation changes based on input. |
| [Number](./number.mdx)     | Outputs a constant number value or converts an input value into a number. Also has the ability to round the number to a specified number of decimal places.                                                                                            |
| [RNG](./rng.mdx)           | Generates a random number within a specified range, either as integers or floating-point numbers. Useful for creating randomized behavior in your graph.                                                                                               |

## Objects

| Node                                             | Description                                                                                                                                                                                                                                                             |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Extract JSON](./extract-json.mdx)               | Extracts a JSON object or array from a string, ignoring any data outside of the JSON structure. Particularly useful for extracting structured data from responses that contain a JSON object.                                                                           |
| [Extract Object Path](./extract-object-path.mdx) | Allows users to run jsonpath queries on an object, a useful function for extracting data from a JSON object or array. Can handle complex queries and work with different data types including objects, arrays, and strings.                                             |
| [Extract YAML](./extract-yaml.mdx)               | Parses a YAML object from a string, particularly useful for extracting structured data from a text string containing a YAML object. Identifies a predefined root property name in the input text and considers all indented text after that as part of the YAML object. |
| [Object](./object.mdx)                           | Creates an object from input values and a JSON template, supporting any data type as input and outputting an object. Particularly useful for creating objects from multiple inputs.                                                                                     |

## Data

| Node                 | Description                                                                                                                                                                                                                                                             |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Audio](./audio.mdx) | Defines an audio sample for use with other nodes, and can convert a binary type into an audio type. Can take an input representing the audio data or use an audio file specified in the node's settings.                                                                |
| [Bool](./bool.mdx)   | Outputs a boolean constant or converts an input value into a boolean, following JavaScript's rules for truthy and falsy values. Can be used to create a boolean value for use in other nodes, or to check if an array is empty, a string is empty, or a number is zero. |
| [Hash](./hash.mdx)   | Computes a hash of the input value using the configured hash function, supporting MD5, SHA-1, SHA-256, and SHA-512 hash algorithms. Useful for generating unique IDs, checksums, and other purposes.                                                                    |
| [Image](./image.mdx) | Defines a static image for use with other nodes. Can convert a binary type into an image type, requires a media type (PNG, JPEG, or GIF) and a data input, which can be provided directly or dynamically.                                                               |

## Logic

| Node                             | Description                                                                                                                                                                                                                                                                                      |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Abort Graph](./abort-graph.mdx) | Immediately stops the execution of the entire graph, either successfully (early-exit) or with an error. Allows for the control of graph execution under specific conditions or for error handling.                                                                                               |
| [Coalesce](./coalesce.mdx)       | Functions like the `COALESCE` function in SQL, returning the first non-null value from a list of inputs. Particularly useful for handling a set of nodes, one of which will be run, and returning the output of the first one that actually runs.                                                |
| [Compare](./compare.mdx)         | Performs comparison operations between two input values, supporting functions such as equality, inequality, logical operations, and more. Can handle various data types and attempts to coerce the second input to match the first if they are not of the same type.                             |
| [Delay](./delay.mdx)             | Introduces a pause in the execution of the graph, passing input values to outputs after a specified delay. Useful for timing control in your graph's execution.                                                                                                                                  |
| [If](./if.mdx)                   | Accepts a condition and a value. Depending on the truthiness of the condition, the value is passed through either the True or False port. Used for conditional operations and comparisons.                                                                                                       |
| [If/Else](./if-else.mdx)         | Allows for decision-making in the control flow by choosing between two different values based on a condition. Particularly useful for ensuring that a graph always returns a value, or that a later node always receives a value even if intermediate nodes do not run.                          |
| [Match](./match.mdx)             | Matches a string input against a series of regular expressions, routing control flow based on the content of the string. Executes the output port for each matching regular expression and the `Unmatched` output port if no match is found.                                                     |
| [Passthrough](./passthrough.mdx) | Transfers the input value directly to the output without modification. Useful for grouping values from different branches of your graph or controlling wire flow without altering the value.                                                                                                     |
| [Race Inputs](./race-inputs.mdx) | Manages multiple inputs, outputting the value of the first input to complete while cancelling the remaining inputs. Especially useful when dealing with multiple operations that could satisfy the same requirement, allowing for the use of the result from the operation that concludes first. |

## Input/Output

| Node                                         | Description                                                                                                                                                                                                                                                                     |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Append to Dataset](./append-to-dataset.mdx) | Appends a row of data to a specified dataset, making it useful for adding new data to an existing dataset for further processing or analysis. Requires a dataset provider to be available in the context when the graph is being run.                                           |
| [Create Dataset](./create-dataset.mdx)       | Generates a new dataset with a unique ID and name. Beneficial for creating new datasets for data storage or processing and requires a dataset provider to manage the storage and retrieval of datasets.                                                                         |
| [Get All Datasets](./get-all-datasets.mdx)   | Retrieves all datasets available in the current project, useful in accessing and manipulating multiple datasets or searching for a specific dataset. Requires a dataset provider to manage the storage and retrieval of datasets.                                               |
| [Get Dataset Row](./get-dataset-row.mdx)     | Retrieves a specific row from a dataset by providing the dataset ID and the row ID. Useful for accessing and processing specific rows of data in a dataset by their ID.                                                                                                         |
| [Graph Input](./graph-input.mdx)             | Defines an input for a graph, which can be passed in when the graph is called using the SDK or defines one of the input ports when the graph is used as a subgraph. Especially useful for creating reusable subgraphs that can accept different inputs each time they are used. |
| [Graph Output](./graph-output.mdx)           | Defines the outputs of a graph, with each instance representing an individual output. Turns into an output port when the graph is used as a subgraph, and the value passed into becomes part of the overall graph output.                                                       |
| [KNN Dataset](./knn-dataset.mdx)             | Finds the k nearest neighbors in a dataset given an embedding. Useful for locating the most similar items in a dataset to a specified item. Requires a dataset provider to manage the storage and retrieval of datasets.                                                        |
| [Load Dataset](./load-dataset.mdx)           | Loads the entire contents of a dataset into a graph, which can then be used in other nodes. Outputs an array of dataset rows and requires a dataset provider to be available in the context when the graph is being run.                                                        |
| [Read Directory](./read-directory.mdx)       | Reads the contents of a specified directory and outputs an array of filenames. Can be configured to read directories recursively, include directories in the output, filter the filenames, return relative paths, and ignore certain files or directories.                      |
| [Read File](./read-file.mdx)                 | Reads the contents of a specified file from the file system and outputs it as a string. Requires a native API to be available in the context when the graph is being run and offers settings to handle errors and dynamic file paths.                                           |
| [User Input](./user-input.mdx)               | Prompts the user for input during the execution of the graph, and the user's response becomes the output of the node. Can use a static prompt defined in the node settings or dynamic prompts provided via the node's input.                                                    |
| [Vector Store](./vector-store.mdx)           | Stores vector embeddings in a vector database. Accepts a vector and associated data for storage, which can later be retrieved for similarity searches.                                                                                                                          |
| [Vector KNN](./vector-knn.mdx)               | Performs a k-nearest neighbors search on vectors stored in a configured vector database integration. Particularly useful when working with vector databases like Pinecone to find the most similar vectors in the database to a given input vector.                             |

## Advanced

| Node                                     | Description                                                                                                                                                                                                                                                                                       |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Code](./code.mdx)                       | Executes arbitrary JavaScript code during a graph's operation. Capable of performing complex calculations, custom logic and using JavaScript functions not available in other nodes. Supports customizable inputs and outputs, and includes error handling capabilities.                          |
| [Comment](./comment.mdx)                 | Adds notes or comments to a graph, providing additional context or explanation. Always rendered behind other nodes and features a distinct, customizable appearance.                                                                                                                              |
| [Context](./context.mdx)                 | Allows access to shared inputs across any graph, acting as a global value holder. Beneficial for accessing and passing "global context" to projects, such as the current date.                                                                                                                    |
| [External Call](./external-call.mdx)     | Executes external functions within a graph when Rivet is running from a host application. Useful for tasks such as getting data from your database, calling web APIs, and retrieving user information. However, it's not available when running Rivet in the Rivet application.                   |
| [Get Global](./get-global.mdx)           | Retrieves a global value that is shared across all graphs and subgraphs. Can be configured to retrieve the value on demand or to wait until the variable is available, making it adaptable to various execution scenarios.                                                                        |
| [HTTP Call](./http-call.mdx)             | Makes an HTTP call to a specified URL with a given method, headers, and body. Especially useful for interacting with external APIs or services. Supports all HTTP methods and allows custom headers and a request body.                                                                           |
| [Loop Controller](./loop-controller.mdx) | Creates loops within your graph, controlling the flow of values and maintaining the state of the loop. Contains a dynamic number of pairs of inputs and outputs, with the ability to control the continuation of the loop through a `Continue` input port.                                        |
| [Raise Event](./raise-event.mdx)         | Triggers an event within the graph, which can be picked up by the host project or a 'Wait For Event Node' in the same graph. Requires an event name and optional event data, allowing actions to be initiated or different parts of the graph to be synchronized based on the state of the graph. |
| [Set Global](./set-global.mdx)           | Sets a global value that is shared across all graphs and subgraphs during an execution in Rivet. Allows you to specify the ID of the global value and the value itself, which can be of any data type.                                                                                            |
| [Subgraph](./subgraph.mdx)               | Executes another graph within the current graph, facilitating logic reuse and complex graph breakdown. Automatically updates its inputs and outputs to match the selected subgraph and has an optional error output for handling execution errors.                                                |
| [Wait For Event](./wait-for-event.mdx)   | Pauses the execution of a graph until a specific event is signaled by a Raise Event Node or the host project. Beneficial for cases where the graph execution needs to wait for an external event, like a user's click or an API call completion.                                                  |
